﻿using System;

public static class NumberExtendtions
{
    public static bool IsNumber(this Type type)
    {
        return type.Equals(typeof(Byte))
            || type.Equals(typeof(Int16))
            || type.Equals(typeof(Int32))
            || type.Equals(typeof(Int64))
            || type.Equals(typeof(SByte))
            || type.Equals(typeof(UInt16))
            || type.Equals(typeof(UInt32))
            || type.Equals(typeof(UInt64))
            || type.Equals(typeof(Decimal))
            || type.Equals(typeof(Double))
            || type.Equals(typeof(Single));
    }
    public static bool IsDateTime(this Type type)
    {
        return type.Equals(typeof(DateTime))
            || type.Equals(typeof(DateTimeOffset));
    }
    public static bool IsString(this Type type)
    {
        return type.Equals(typeof(String));
    }
    public static bool IsInt(this Type type)
    {
        return type.Equals(typeof(Int16))
            || type.Equals(typeof(Int32))
            || type.Equals(typeof(UInt16))
            || type.Equals(typeof(UInt32));
    }
    public static bool IsLong(this Type type)
    {
        return type.Equals(typeof(Int64))
            || type.Equals(typeof(UInt64))
            || type.Equals(typeof(Int64));
    }
    public static bool IsShort(this Type type)
    {
        return type.Equals(typeof(Byte))
            || type.Equals(typeof(SByte));
    }
    public static bool IsFloat(this Type type)
    {
        return type.Equals(typeof(Decimal))
            || type.Equals(typeof(Double))
            || type.Equals(typeof(Single));
    }
    public static bool IsUInt(this Type type)
    {
        return type.Equals(typeof(UInt16))
           || type.Equals(typeof(UInt32))
           || type.Equals(typeof(UInt64));
    }
}
